home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / QuickDraw 3D / Samples / SampleCode / ScreenSaver / Twist 1.0.sit / Twist 1.0 / Library Source / FindProcess.c next >
MacBinary  |  1992-04-23  |  2.0 KB  |  [TEXT/KAHL]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Thu Apr 23 05:38:03 1992, modified Thu Apr 23 05:38:03 1992, creator Think C, type ASCII, 1377 bytes "FindProcess.c" , at 0x5e1 410 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0d 46 69 6e 64 50 72 | 6f 63 65 73 73 2e 63 00 |..FindPr|ocess.c.|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 00 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 05 61 00 | 00 01 9a a6 1c 35 fb a6 |......a.|.....5..|
|00000060| 1c 35 fb 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.5......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 01 7e 00 00 |........|.....~..|
|00000080| 2f 2a 20 46 69 6e 64 50 | 72 6f 63 65 73 73 2e 63 |/* FindP|rocess.c|
|00000090| 0d 20 2a 20 46 69 6e 64 | 20 61 20 70 72 6f 63 65 |. * Find| a proce|
|000000a0| 73 73 2c 20 61 6e 64 20 | 67 65 74 20 69 6e 66 6f |ss, and |get info|
|000000b0| 72 6d 61 74 69 6f 6e 20 | 61 62 6f 75 74 20 69 74 |rmation |about it|
|000000c0| 2e 20 20 46 72 6f 6d 20 | 49 4d 20 49 56 2c 20 70 |. From |IM IV, p|
|000000d0| 2e 20 32 39 2d 31 31 0d | 20 2a 20 a9 31 39 39 32 |. 29-11.| * .1992|
|000000e0| 20 57 6f 72 6b 69 6e 67 | 20 53 6f 66 74 77 61 72 | Working| Softwar|
|000000f0| 65 2c 20 49 6e 63 2e 0d | 20 2a 20 54 68 69 73 20 |e, Inc..| * This |
|00000100| 73 6f 75 72 63 65 20 63 | 6f 64 65 20 69 73 20 63 |source c|ode is c|
|00000110| 6f 70 79 72 69 67 68 74 | 65 64 2e 20 20 50 65 72 |opyright|ed. Per|
|00000120| 6d 69 73 73 69 6f 6e 20 | 69 73 20 67 72 61 6e 74 |mission |is grant|
|00000130| 65 64 20 74 6f 20 75 73 | 65 20 74 68 65 20 57 6f |ed to us|e the Wo|
|00000140| 72 64 20 53 65 72 76 69 | 63 65 73 0d 20 2a 20 70 |rd Servi|ces. * p|
|00000150| 6f 72 74 69 6f 6e 20 6f | 66 20 74 68 65 20 57 72 |ortion o|f the Wr|
|00000160| 69 74 65 73 77 65 6c 6c | 20 4a 72 2e 20 73 6f 75 |iteswell| Jr. sou|
|00000170| 72 63 65 20 63 6f 64 65 | 20 69 6e 20 79 6f 75 72 |rce code| in your|
|00000180| 20 6f 77 6e 20 70 72 6f | 67 72 61 6d 73 2c 20 62 | own pro|grams, b|
|00000190| 75 74 20 79 6f 75 20 0d | 20 2a 20 6d 61 79 20 6e |ut you .| * may n|
|000001a0| 6f 74 20 64 69 73 74 72 | 69 62 75 74 65 20 74 68 |ot distr|ibute th|
|000001b0| 65 20 57 72 69 74 65 73 | 77 65 6c 6c 20 4a 72 2e |e Writes|well Jr.|
|000001c0| 20 77 6f 72 64 2d 70 72 | 6f 63 65 73 73 6f 72 20 | word-pr|ocessor |
|000001d0| 63 6f 64 65 20 61 73 20 | 61 20 0d 20 2a 20 63 6f |code as |a . * co|
|000001e0| 6d 6d 65 72 63 69 61 6c | 20 70 72 6f 64 75 63 74 |mmercial| product|
|000001f0| 2e 20 20 49 66 20 79 6f | 75 20 6d 6f 64 69 66 79 |. If yo|u modify|
|00000200| 20 74 68 65 20 63 6f 64 | 65 2c 20 70 6c 65 61 73 | the cod|e, pleas|
|00000210| 65 20 64 6f 20 6e 6f 74 | 20 63 61 6c 6c 20 69 74 |e do not| call it|
|00000220| 20 0d 20 2a 20 57 72 69 | 74 65 73 77 65 6c 6c 20 | . * Wri|teswell |
|00000230| 4a 72 2e 20 28 6f 72 20 | 57 72 69 74 65 73 77 65 |Jr. (or |Writeswe|
|00000240| 6c 6c 2e 29 20 20 54 68 | 69 73 20 77 69 6c 6c 20 |ll.) Th|is will |
|00000250| 65 6e 73 75 72 65 20 74 | 68 61 74 20 70 65 6f 70 |ensure t|hat peop|
|00000260| 6c 65 20 75 6e 64 65 72 | 73 74 61 6e 64 20 74 68 |le under|stand th|
|00000270| 65 20 0d 20 2a 20 70 72 | 6f 67 72 61 6d 20 61 6e |e . * pr|ogram an|
|00000280| 64 20 64 6f 6e d5 74 20 | 68 61 76 65 20 74 6f 20 |d don.t |have to |
|00000290| 64 65 61 6c 20 77 69 74 | 68 20 61 20 6e 75 6d 62 |deal wit|h a numb|
|000002a0| 65 72 20 6f 66 20 64 69 | 66 66 65 72 65 6e 74 20 |er of di|fferent |
|000002b0| 76 65 72 73 69 6f 6e 73 | 20 77 69 74 68 20 0d 20 |versions| with . |
|000002c0| 2a 20 77 68 6f 2d 6b 6e | 6f 77 73 2d 77 68 61 74 |* who-kn|ows-what|
|000002d0| 20 67 6f 69 6e 67 20 6f | 6e 20 69 6e 20 74 68 65 | going o|n in the|
|000002e0| 20 63 6f 64 65 2e 0d 20 | 2a 20 0d 20 2a 20 57 72 | code.. |* . * Wr|
|000002f0| 69 74 65 73 77 65 6c 6c | 20 4a 72 2e 20 61 6e 64 |iteswell| Jr. and|
|00000300| 20 57 72 69 74 65 73 77 | 65 6c 6c 20 61 72 65 20 | Writesw|ell are |
|00000310| 74 72 61 64 65 6d 61 72 | 6b 73 20 6f 66 20 57 6f |trademar|ks of Wo|
|00000320| 72 6b 69 6e 67 20 53 6f | 66 74 77 61 72 65 2c 20 |rking So|ftware, |
|00000330| 49 6e 63 2e 0d 20 2a 20 | 32 32 20 41 70 72 20 39 |Inc.. * |22 Apr 9|
|00000340| 32 20 4d 69 6b 65 20 43 | 72 61 77 66 6f 72 64 0d |2 Mike C|rawford.|
|00000350| 20 2a 2f 0d 0d 23 69 6e | 63 6c 75 64 65 20 3c 50 | */..#in|clude <P|
|00000360| 72 6f 63 65 73 73 65 73 | 2e 68 3e 0d 23 69 6e 63 |rocesses|.h>.#inc|
|00000370| 6c 75 64 65 20 22 46 69 | 6e 64 50 72 6f 63 65 73 |lude "Fi|ndProces|
|00000380| 73 2e 68 22 0d 0d 42 6f | 6f 6c 65 61 6e 20 46 69 |s.h"..Bo|olean Fi|
|00000390| 6e 64 41 50 72 6f 63 65 | 73 73 28 20 4f 53 54 79 |ndAProce|ss( OSTy|
|000003a0| 70 65 20 73 69 67 6e 61 | 74 75 72 65 2c 0d 09 09 |pe signa|ture,...|
|000003b0| 09 09 09 09 50 72 6f 63 | 65 73 73 53 65 72 69 61 |....Proc|essSeria|
|000003c0| 6c 4e 75 6d 62 65 72 20 | 2a 70 73 6e 50 74 72 2c |lNumber |*psnPtr,|
|000003d0| 0d 09 09 09 09 09 09 50 | 72 6f 63 65 73 73 49 6e |.......P|rocessIn|
|000003e0| 66 6f 52 65 63 20 2a 70 | 49 6e 66 6f 50 74 72 2c |foRec *p|InfoPtr,|
|000003f0| 0d 09 09 09 09 09 09 46 | 53 53 70 65 63 50 74 72 |.......F|SSpecPtr|
|00000400| 20 66 53 70 65 63 50 74 | 72 2c 0d 09 09 09 09 09 | fSpecPt|r,......|
|00000410| 09 53 74 72 69 6e 67 50 | 74 72 09 70 72 6f 63 4e |.StringP|tr.procN|
|00000420| 61 6d 65 20 29 0d 7b 0d | 09 70 73 6e 50 74 72 2d |ame ).{.|.psnPtr-|
|00000430| 3e 68 69 67 68 4c 6f 6e | 67 4f 66 50 53 4e 20 3d |>highLon|gOfPSN =|
|00000440| 20 30 3b 0d 09 70 73 6e | 50 74 72 2d 3e 6c 6f 77 | 0;..psn|Ptr->low|
|00000450| 4c 6f 6e 67 4f 66 50 53 | 4e 20 3d 20 6b 4e 6f 50 |LongOfPS|N = kNoP|
|00000460| 72 6f 63 65 73 73 3b 0d | 09 0d 09 70 49 6e 66 6f |rocess;.|...pInfo|
|00000470| 50 74 72 2d 3e 70 72 6f | 63 65 73 73 49 6e 66 6f |Ptr->pro|cessInfo|
|00000480| 4c 65 6e 67 74 68 20 3d | 20 73 69 7a 65 6f 66 28 |Length =| sizeof(|
|00000490| 20 50 72 6f 63 65 73 73 | 49 6e 66 6f 52 65 63 20 | Process|InfoRec |
|000004a0| 29 3b 0d 09 70 49 6e 66 | 6f 50 74 72 2d 3e 70 72 |);..pInf|oPtr->pr|
|000004b0| 6f 63 65 73 73 4e 61 6d | 65 20 3d 20 70 72 6f 63 |ocessNam|e = proc|
|000004c0| 4e 61 6d 65 3b 0d 09 70 | 49 6e 66 6f 50 74 72 2d |Name;..p|InfoPtr-|
|000004d0| 3e 70 72 6f 63 65 73 73 | 41 70 70 53 70 65 63 20 |>process|AppSpec |
|000004e0| 3d 20 66 53 70 65 63 50 | 74 72 3b 0d 0d 09 77 68 |= fSpecP|tr;...wh|
|000004f0| 69 6c 65 28 20 47 65 74 | 4e 65 78 74 50 72 6f 63 |ile( Get|NextProc|
|00000500| 65 73 73 28 20 70 73 6e | 50 74 72 20 29 20 3d 3d |ess( psn|Ptr ) ==|
|00000510| 20 6e 6f 45 72 72 20 29 | 7b 0d 09 09 69 66 20 28 | noErr )|{...if (|
|00000520| 20 47 65 74 50 72 6f 63 | 65 73 73 49 6e 66 6f 72 | GetProc|essInfor|
|00000530| 6d 61 74 69 6f 6e 28 20 | 70 73 6e 50 74 72 2c 20 |mation( |psnPtr, |
|00000540| 70 49 6e 66 6f 50 74 72 | 20 29 20 3d 3d 20 6e 6f |pInfoPtr| ) == no|
|00000550| 45 72 72 20 29 7b 0d 09 | 09 09 69 66 20 28 20 70 |Err ){..|..if ( p|
|00000560| 49 6e 66 6f 50 74 72 2d | 3e 70 72 6f 63 65 73 73 |InfoPtr-|>process|
|00000570| 54 79 70 65 20 3d 3d 20 | 27 41 50 50 4c 27 20 26 |Type == |'APPL' &|
|00000580| 26 0d 09 09 09 09 09 70 | 49 6e 66 6f 50 74 72 2d |&......p|InfoPtr-|
|00000590| 3e 70 72 6f 63 65 73 73 | 53 69 67 6e 61 74 75 72 |>process|Signatur|
|000005a0| 65 20 3d 3d 20 73 69 67 | 6e 61 74 75 72 65 20 29 |e == sig|nature )|
|000005b0| 7b 0d 09 09 09 09 72 65 | 74 75 72 6e 20 74 72 75 |{.....re|turn tru|
|000005c0| 65 3b 0d 09 09 09 7d 09 | 09 0d 09 09 7d 0d 09 7d |e;....}.|....}..}|
|000005d0| 0d 09 72 65 74 75 72 6e | 20 66 61 6c 73 65 3b 0d |..return| false;.|
|000005e0| 7d 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |}.......|........|
|000005f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000600| 00 00 01 00 00 00 01 54 | 00 00 00 54 00 00 00 46 |.......T|...T...F|
|00000610| 00 00 71 31 00 47 00 00 | 00 13 07 00 00 00 72 e4 |..q1.G..|......r.|
|00000620| 00 12 00 00 00 02 07 ff | 00 00 72 e4 00 6c 00 00 |........|..r..l..|
|00000630| 0d 46 69 6e 64 50 72 6f | 63 65 73 73 2e 63 02 00 |.FindPro|cess.c..|
|00000640| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|00000650| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|00000660| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000670| 00 00 ae 65 03 b2 00 00 | 00 00 00 00 01 9a 75 36 |...e....|......u6|
|00000680| 00 89 00 00 00 2f 07 ff | 00 00 75 44 02 28 00 00 |...../..|..uD.(..|
|00000690| 00 33 07 ff 00 00 75 46 | 00 1a 00 00 00 38 07 00 |.3....uF|.....8..|
|000006a0| 00 00 76 36 00 58 00 00 | 00 0e 07 ff 00 00 76 c8 |..v6.X..|......v.|
|000006b0| 00 2a 00 00 00 0c 07 00 | 00 00 80 7b 00 10 00 00 |.*......|...{....|
|000006c0| 00 24 07 ff 00 00 85 23 | 00 b4 00 00 00 0a 07 00 |.$.....#|........|
|000006d0| 00 00 86 d4 00 09 00 00 | 00 1f 07 00 00 00 87 4c |........|.......L|
|000006e0| 00 11 00 00 00 04 07 ff | 00 00 8b b7 00 2e 00 00 |........|........|
|000006f0| 00 3a 07 ff 00 00 8b b7 | 01 19 00 00 00 3c 07 ff |.:......|.....<..|
|00000700| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00000710| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000720| 00 00 00 00 00 00 00 03 | 00 04 00 57 00 0a 01 f1 |........|...W....|
|00000730| 02 80 00 57 00 0a 01 f1 | 02 80 ad fe 05 07 00 00 |...W....|........|
|00000740| 02 ec 00 00 03 05 00 00 | 01 5b 01 00 00 00 00 04 |........|.[......|
|00000750| 00 01 00 01 00 00 01 00 | 00 00 01 54 00 00 00 54 |........|...T...T|
|00000760| 00 00 00 46 01 00 f5 f8 | 28 66 00 00 00 1c 00 46 |...F....|(f.....F|
|00000770| 00 01 4d 50 53 52 00 00 | 00 12 4d 57 42 42 00 00 |..MPSR..|..MWBB..|
|00000780| 00 1e 03 ed ff ff 00 00 | 00 00 00 00 00 00 03 f0 |........|........|
|00000790| ff ff 00 00 00 4c 00 00 | 00 00 00 00 00 00 00 00 |.....L..|........|
|000007a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+